<admintpl file="header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>交易记录</a></li>
        <li><a href="{:U('Report/order_pay_report')}">交易记录统计</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('Report/order_pay_list')}">
        用户：
        <input type="text" name="name" style="width: 150px;" value="{:I('request.name')}" placeholder="用户搜索">
        订单号：
        <input type="text" name="orderno" style="width: 150px;" value="{:I('request.orderno')}" placeholder="订单搜索">
        审核人：
        <input type="text" name="admin" style="width: 150px;" value="{:I('request.admin')}" placeholder="审核人搜索">
        <br/><br />
        时间：<input class="js-date" type="text" name="starts" style="width: 200px;" value="{:I('request.starts',date('Y-m-d'))}" placeholder="起始时间">
        <input class="js-date" type="text" name="ends" style="width: 200px;" value="{:I('request.ends',date('Y-m-d'))}" placeholder="结束时间">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="">清空</a>
    </form>
    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th align="center">用户</th>
                <th>交易ID</th>
                <th>订单号</th>
                <th>审核人</th>
                <th>银行</th>
                <th>卡号</th>
                <th>金额</th>
                <th>创建时间</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                    <td align="center">{$users[$vo['user_id']]}</td>
                    <td>{$vo['id']}</td>
                    <td>{$orders[$vo['oid']]}</td>
                    <td>{$examines[$vo['examine_id']]}</td>
                    <td>{$vo.bank}</td>
                    <td>{$vo.accntno}</td>
                    <td>{$vo.amount}</td>
                    <td>{$vo.crtime}</td>
                </tr>
            </foreach>
            </tbody>
            <tfoot>
            <tr>
                <td>当页合计：</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            </tfoot>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    $(function () {
        var arr = [6];//要取哪几列的合计
        var def = 'var ';
        for(var a in arr){
            def += ('total'+arr[a]+'=0,');
        }
        def=def.substring(0,def.length-1)+';';
        eval(def);//执行定义
        $('tbody tr').each(function() {
            for(var i in arr){
                $(this).find('td:eq('+arr[i]+')').each(function(){
                    var tmp = $(this).text();
                    if(tmp === ''){
                        tmp = 0;
                    }
                    eval('total'+arr[i]+'+=parseFloat(tmp);');
                });
            }
        });
        for(var x in arr){
            $('tfoot tr:eq(0)').find('td:eq('+arr[x]+')').text(eval('total'+arr[x]));
        }
    });
</script>
</body>
</html>